#!/bin/bash

# 构建脚本

set -e

echo "开始构建 API Gateway..."

# 下载依赖
echo "下载依赖..."
go mod download

# 运行测试
echo "运行测试..."
go test ./...

# 构建二进制文件
echo "构建二进制文件..."
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/gateway ./cmd/gateway

echo "构建完成: bin/gateway"


